<!--
 * @Description: 一卡通专区商品编辑
 * @Author: Li Yujie
 * @Date: 2020/12/22
 * @Last Modified by: Li Yujie
 * @Last Modified time: 2021-01-12
-->
<template>
    <div class="wrapper">
        <div class="content-wrapper">
            <!-- header -->
            <div class="header">
                <div class="header-title">
                    {{ type === 'add' ? '添加一卡通专区商品' : '编辑一卡通专区商品' }}
                </div>
            </div>
            <!-- /header -->

            <!--表单-->
            <el-form
                :model="ruleForm"
                :rules="rules"
                label-position="right"
                ref="ruleForm"
                label-width="110px"
                class="form-wrap"
            >
                <div class="form-title">选择商品信息</div>
                <el-form-item
                    label=""
                    prop="goods_no"
                    label-width="32px"
                >
                    <div class="select-goods-view">
                        <template v-if="type === 'add'">
                            <div
                                class="select-goods"
                                v-if="!ruleForm.goods_no"
                                @click="$refs.goodsSelect.show(1,requestUrl, typeList)"
                            >
                                <i class="el-icon-plus"/>
                                <div>点击选择商品</div>
                            </div>
                            <div
                                class="select-goods selected"
                                v-else
                                @click="$refs.goodsSelect.show(1,requestUrl, typeList)"
                            >
                                <el-image
                                    :src="ruleForm.goods_cover"
                                    fit="cover"
                                >
                                    <div
                                        slot="error"
                                        class="image-slot"
                                    >
                                        <i class="el-icon-picture-outline"/>
                                    </div>
                                </el-image>
                            </div>
                        </template>
                        <template v-else>
                            <div class="select-goods detail">
                                <el-image :src="ruleForm.goods_cover">
                                    <div
                                        slot="error"
                                        class="image-slot"
                                    >
                                        <i class="el-icon-picture-outline"/>
                                    </div>
                                </el-image>
                            </div>
                        </template>
                        <div class="select-goods-info">
                            <div class="goods-info-item">
                                <div class="goods-info__label">商品名称</div>
                                <div class="goods-info__value">
                                    <el-input
                                        v-model="ruleForm.goods_title"
                                        disabled
                                        size="medium"
                                    />
                                </div>
                            </div>
                            <div class="goods-info-item">
                                <div class="goods-info__label">商品ID</div>
                                <div class="goods-info__value">
                                    <el-input
                                        v-model="ruleForm.goods_no"
                                        disabled
                                        size="medium"
                                        style="width: 356px"
                                    />
                                </div>
                            </div>
                        </div>
                    </div>
                </el-form-item>
                <div class="form-title">一卡通商品折扣设置</div>
                <el-form-item
                    label="优惠内容"
                    prop="goods_discount_vip"
                >
                    <span style="margin-right: 12px">打</span>
                    <el-input
                        v-model="ruleForm.goods_discount_vip"
                        size="medium"
                        style="width: 192px"
                        @blur="getPriceVip"
                    >
                        <span
                            slot="suffix"
                            style="margin-right: 6px;color: #666"
                        >
                            折
                        </span>
                    </el-input>
                </el-form-item>
                <el-form-item label-width="32px">
                    <el-table
                        :data="ruleForm.price_list"
                        :height="400"
                        style="width: 100%; border: 1px solid #eee"
                        :cell-style="{height: '22px'}"
                        empty-text="暂无数据信息，请上方的“点击添加商品”进行添加"
                    >
                        <el-table-column
                            label="商品规格"
                            show-overflow-tooltip
                        >
                            <template slot-scope="scope">
                                <div class="zd-spec">
                                    <div
                                        v-for="(item,index) in scope.row.spec_list"
                                        :key="index"
                                        class="zd-spec-text"
                                        style="margin: 0 6px 12px"
                                    >
                                        {{ `${item.spec_name}：${item.spec_value}` }}
                                    </div>
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="学生价"
                            prop="product_price"
                            align="center"
                            :formatter="emptyFormatter"
                        >
                            <template slot-scope="scope">
                                <div style="margin-bottom: 12px">
                                    {{ `￥${scope.row.product_price}` }}
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="团购价"
                            align="center"
                            show-overflow-tooltip
                            :formatter="emptyFormatter"
                        >
                            <template slot-scope="scope">
                                <div style="margin-bottom: 12px">
                                    <el-button
                                        type="text"
                                        @click="getGroupPrice(scope.row)"
                                        v-if="discountList.length"
                                    >
                                        查看
                                    </el-button>
                                    <div v-else>--</div>
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="一卡通价"
                            prop="price_vip"
                            align="center"
                            show-overflow-tooltip
                            :formatter="emptyFormatter"
                        >
                            <template slot-scope="scope">
                                <div style="margin-bottom: 12px">{{ scope.row.price_vip === '--' ? '--' : `￥${scope.row.price_vip}` }}</div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="活动库存"
                            align="left"
                            width="210"
                        >
                            <template slot-scope="scope">
                                <div
                                    class="input-wrapper"
                                    style="display: flex; align-items: center;"
                                >
                                    <el-select
                                        v-model="scope.row.product_stock_type"
                                        style="width: 130px;margin-bottom: 12px"
                                        :style="{width: scope.row.product_stock_type === 1 ? '138px' : '108px'}"
                                        size="medium"
                                        @change="handleStockTypeChange($event, scope.$index)"
                                    >
                                        <el-option
                                            label="同步商家库存"
                                            :value="1"
                                        />
                                        <el-option
                                            label="自定义"
                                            :value="2"
                                        />
                                    </el-select>
                                    <el-form-item
                                        :prop="`price_list[${scope.$index}].product_stock_vip`"
                                        :rules="rules.product_stock_vip"
                                        style="margin-bottom: 12px"
                                        v-if="scope.row.product_stock_type === 2"
                                    >
                                        <el-input
                                            oninput="value = value.replace(/[^\d]/g,'')"
                                            placeholder="活动库存"
                                            v-model.number="scope.row.product_stock_vip"
                                            style="width: 88px;margin-left: 10px;"
                                            size="medium"
                                        />
                                    </el-form-item>
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="商家实际库存"
                            prop="product_stock"
                            align="center"
                            show-overflow-tooltip
                            :formatter="emptyFormatter"
                            width="120"
                        >
                            <template slot-scope="scope">
                                <div style="margin-bottom: 12px">{{ scope.row.product_stock }}</div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="原佣金"
                            align="center"
                            show-overflow-tooltip
                            :formatter="emptyFormatter"
                        >
                            <template slot-scope="scope">
                                <div style="margin-bottom: 12px">{{ scope.row.goods_commission_rate }}%</div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="活动佣金（%）"
                            width="210"
                        >
                            <template slot-scope="scope">
                                <div
                                    class="input-wrapper"
                                    style="display: flex; align-items: center;"
                                >
                                    <el-select
                                        v-model="scope.row.commission_rate_type"
                                        style="width: 130px;margin-bottom: 12px"
                                        :style="{width: scope.row.commission_rate_type === 1 ? '138px' : '108px'}"
                                        size="medium"
                                        @change="handleRateTypeChange($event, scope.row)"
                                    >
                                        <el-option
                                            label="同步原佣金"
                                            :value="1"
                                        />
                                        <el-option
                                            label="自定义"
                                            :value="2"
                                        />
                                    </el-select>
                                    <el-form-item
                                        :prop="`price_list[${scope.$index}].commission_rate`"
                                        :rules="rules.commission_rate"
                                        style="margin-bottom: 12px"
                                        v-if="scope.row.commission_rate_type === 2"
                                    >
                                        <el-input
                                            v-model="scope.row.commission_rate"
                                            placeholder="活动佣金"
                                            size="medium"
                                            clearable
                                            style="width: 88px;margin-left: 10px;"
                                        />
                                    </el-form-item>
                                </div>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="是否平台补贴"
                            align="center"
                            width="200px"
                        >
                            <template slot-scope="scope">
                                <el-select
                                    v-model="scope.row.shop_subsidy_enable"
                                    size="medium"
                                    style="width: 140px;margin-bottom: 12px"
                                    @change="handleSubsidyChange($event, scope.$index)"
                                >
                                    <el-option
                                        label="平台补贴"
                                        :value="1"
                                    />
                                    <el-option
                                        label="商家全部补贴"
                                        :value="0"
                                    />
                                    <el-option
                                        label="商家部分补贴"
                                        :value="2"
                                    />
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="商家补贴金额（元）"
                            align="center"
                            width="200px"
                        >
                            <template slot-scope="scope">
                                <div
                                    class="input-wrapper"
                                    style="display: flex; align-items: center;justify-content: center"
                                >
                                    <el-form-item
                                        :prop="`price_list[${scope.$index}]`"
                                        :rules="rules.shop_subsidy_money_by_shop"
                                        style="margin-bottom: 12px"
                                    >
                                        <el-input
                                            v-model="scope.row.shop_subsidy_money_by_shop"
                                            placeholder="商家补贴金额"
                                            size="medium"
                                            clearable
                                            style="width: 120px"
                                            :disabled="scope.row.shop_subsidy_enable !== 2"
                                        />
                                    </el-form-item>
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-form-item>
                <div class="form-title">限购和显示设置</div>
                <el-form-item
                    label="排序号"
                    prop="goods_sort_vip"
                >
                    <el-input
                        oninput="value = value.replace(/[^\d]/g,'')"
                        v-model.number="ruleForm.goods_sort_vip"
                        size="medium"
                        clearable
                        style="width: 218px"
                    />
                    <span class="tips">在一卡通专区显示的位置，越小越靠前</span>
                </el-form-item>
                <el-form-item
                    label="限购设置"
                    prop="goods_buy_limit_vip"
                >
                    <el-radio-group
                        v-model="ruleForm.limit_type"
                        class="el-radio-group-wrap"
                        @change="handleLimitChange"
                    >
                        <el-radio
                            :label="1"
                            class="el-radio-wrap"
                        >
                            不限制购买数量
                        </el-radio>
                        <el-radio
                            :label="2"
                            class="el-radio-wrap sec"
                            :style="{marginTop: '24px'}"
                        >
                            <div>限制购买数量</div>
                            <div style="margin-top: 12px">
                                每个会员月限购
                                <el-input
                                    oninput="value=value.replace(/[^0-9.]/g,'')"
                                    type="text"
                                    v-model.number="ruleForm.goods_buy_limit_vip"
                                    size="medium"
                                    :style="{width: '127px',marginLeft: '6px'}"
                                    :disabled="ruleForm.limit_type === 1"
                                >
                                    <p
                                        slot="suffix"
                                        :style="{color: 'rgba(102, 102, 102, 1)', marginRight: '5px', marginTop: '12px'}"
                                    >
                                        个
                                    </p>
                                </el-input>
                            </div>
                        </el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item
                    label="活动状态设置"
                >
                    <el-switch
                        v-model="ruleForm.goods_status_vip"
                        active-text="上架"
                        inactive-text="下架"
                        :active-value="1"
                        :inactive-value="0"
                    />
                </el-form-item>
                <el-form-item
                    label="显示区域"
                >
                    <el-select
                        v-model="ruleForm.category"
                        size="medium"
                        style="width: 218px"
                    >
                        <el-option
                            label="一卡通专区"
                            :value="0"
                        />
                        <el-option
                            label="热销专区"
                            :value="1"
                        />
                    </el-select>
                </el-form-item>
            </el-form>
            <!--/表单-->

            <div class="btn-group">
                <el-button
                    size="medium"
                    style="width: 120px;"
                    @click="handleCancel()"
                >
                    取消
                </el-button>
                <el-button
                    size="medium"
                    type="primary"
                    style="width: 120px;"
                    @click="handleSubmit()"
                >
                    完成
                </el-button>
            </div>
        </div>

        <!--商品选择弹窗-->
        <goods-select
            ref="goodsSelect"
            @change="handleSelectGoods"
        />
        <!-- 图片预览 -->
        <img-preview ref="preview"/>
        <!-- 团购价弹窗 -->
        <group-price-dialog
            ref="groupPriceDialog"
        />
    </div>
</template>

<script>
/**
 * 页面接收参数
 * @param no - 商品编号
 */
import {back} from '@/mixin/back';
import GoodsSelect from '@/components/goods/goods-select';
import imgPreview from '@/components/common/img-preview';
import GroupPriceDialog from '@/components/member-card/group-price-dialog';
const numberReg = /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/;

export default {
    name: "MemberGoodsEdit",
    data() {
        const validateMemberGoodsCount = (rule, value, callback) => {
            if (this.ruleForm.limit_type === 2 && value === '') {
                callback(new Error('请填写会员专区每月限领数量'));
            } else {
                callback();
            }
        };
        const checkPrice = (rule, value, callback) => {
            if(value.shop_subsidy_money_by_shop === '') {
                callback(new Error('商家补贴不能为空'));
            } else if(value.price_vip !== '--') {
                let offset = Number(value.product_price) - Number(value.price_vip);

                if(Number(value.shop_subsidy_money_by_shop) > offset) {
                    callback(new Error('不能大于全部补贴'));
                } else {
                    callback();
                }
            } else {
                callback(new Error('请先填写折扣'));
            }
        };

        return {
            ruleForm: {
                // 商品编号
                goods_no: '',
                // 封面图
                goods_cover: '',
                // 商品标题
                goods_title: '',
                // 折扣
                goods_discount_vip: '',
                // 排序号
                goods_sort_vip: 99,
                // 上架状态
                goods_status_vip: 0,
                // 规格价格列表
                price_list: [],
                // 限购类型
                limit_type: 1,
                // 限购数量
                goods_buy_limit_vip: 0,
                // 显示专区 1：一卡通 2：热销
                category: 0
            },
            // 校验规则
            rules: {
                goods_no: [
                    {required: true, message: '请选择商品', trigger: 'blur'}
                ],
                goods_sort_vip: [
                    {required: true, message: '排序号不能为空', trigger: 'blur'}
                ],
                product_stock_vip: [
                    {required: true, message: '活动库存不能为空', trigger: 'blur'}
                ],
                shop_subsidy_money_by_shop: [
                    {required: true, message: '商家补贴不能为空', trigger: 'blur'},
                    {validator: checkPrice, trigger: 'blur'}
                ],
                goods_buy_limit_vip: [
                    {validator: validateMemberGoodsCount, trigger: 'blur'}
                ],
                goods_discount_vip: [
                    {pattern: /^((0.[1-9]{1,2})|(([1-9]{1})(.\d{1,2})?))$/, message: '请输入正确的折扣', trigger: 'blur'},
                    {required: true, message: '折扣不能为空', trigger: 'blur'},
                ],
                commission_rate: [
                    {required: true, message: '活动佣金不能为空', trigger: 'blur'},
                    {pattern: numberReg, message: '活动佣金格式错误', trigger: 'blur'},
                ]
            },
            type: 'add',
            // 商品弹窗类型
            typeList: [
                {label: '自营', value: 1},
                {label: '折扣', value: 5},
                {label: '秒杀', value: 3}
            ],
            requestUrl: '/student/shop_vip_goods%5Cget_depot_goods_list',
            discountList: [],
        };
    },
    mixins: [back],
    components: {
        GoodsSelect,
        imgPreview,
        GroupPriceDialog,
    },
    mounted() {
        this.init();
    },
    methods: {
        init() {
            let query = this.$route.query;

            this.$store.commit('SET_HEADER', [{title: "APP后台"}, {title: '商城'}, {
                title: '一卡通专区',
                path: '/student/member-area-list'
            }, {title: query.type === 'add' ? '添加一卡通专区商品' : '编辑一卡通专区商品'}]);

            this.type = query.type;
            if (query.no) {
                this.ruleForm.goods_no = query.no;
                this.getDetail();
            }
        },
        /**
         * 获取选择的商品
         * @param val
         */
        handleSelectGoods(val) {
            this.ruleForm.goods_no = val.goods_no;
            this.ruleForm.goods_cover = val.goods_cover;
            this.ruleForm.goods_title = val.goods_title;

            this.getProductList(val.goods_commission_rate);
        },
        /**
         * 查看图片
         * @param   {String}    images      //单图预览
         * @param   {Array}     images      //多图预览
         */
        fnShowPreview(images) {
            if (images && Object.prototype.toString.call(images) == '[object String]') {
                this.$refs.preview.show([
                    images
                ]);
            } else if (images && Object.prototype.toString.call(images) == '[object Array]') {
                this.$refs.preview.show(images);
            } else {
                this.$message({
                    type: 'warning',
                    message: '图片类型错误'
                });
            }
        },

        /**
         * 提交
         */
        handleSubmit() {
            this.$refs.ruleForm.validate((valid) => {

                if (valid) {
                    let params = {...this.ruleForm};

                    params.product_json = JSON.stringify(params.price_list);
                    delete params.price_list;

                    this.$post('/student/shop_vip_goods%5Csave', params, resp => {
                        if (resp.code === 1) {
                            if(resp.data.result === 1) {
                                this.$notify({
                                    title: '提示',
                                    message: '保存成功',
                                    type: 'success',
                                    duration: 2000
                                });
                                setTimeout(() => {
                                    this.$router.push({
                                        path: '/student/member-area-list'
                                    });
                                }, 500);
                            } else {
                                this.$zdConfirm(`当前一卡通专区的平台补贴支出${resp.data.result === -1 ? '不在财控计划时间内' : '在计划时间已无预算'} ，暂无法添加一卡通专区商品，如需要增加预算，请联系平台财务人员。`, '温馨提示', {
                                    confirmButtonText: '知道了',
                                    hasCancelButton: false,
                                    type: 'warning'
                                }).then(() => {});
                            }
                        } else {
                            this.$notify({
                                title: '提示',
                                message: resp.msg,
                                duration: 2000,
                                type: 'warning'
                            });
                        }
                    });

                }
            });
        },

        /**
         * 返回列表
         */
        handleCancel() {
            this.$zdConfirm('返回后将不会保存您所修改的内容,是否返回?', '温馨提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$router.push({
                    path: '/student/member-area-list'
                });
            });
        },

        /**
         * 编辑时获取详情
         */
        getDetail() {
            let params = {
                goods_no: this.ruleForm.goods_no
            };

            this.$post('/student/shop_vip_goods%5Cget', params, resp => {
                if (resp.code === 1) {
                    this.ruleForm.goods_no = resp.data.goods_no;
                    this.ruleForm.goods_title = resp.data.goods_title;
                    this.ruleForm.goods_sort_vip = resp.data.goods_sort_vip;
                    this.ruleForm.goods_status_vip = resp.data.goods_status_vip;
                    this.ruleForm.goods_buy_limit_vip = resp.data.goods_buy_limit_vip;
                    this.ruleForm.limit_type = resp.data.goods_buy_limit_vip ? 2 : 1;
                    this.ruleForm.goods_discount_vip = resp.data.goods_discount_vip;

                    this.getProductList(resp.data.goods_commission_rate);
                    this.getGoodsInfo(resp.data.goods_no);
                } else {
                    this.$notify({
                        title: '提示',
                        message: resp.msg,
                        duration: 2000,
                        type: 'warning'
                    });
                }
            });
        },

        /**
         * 详情时获取产品规格信息
         */
        getProductList(goods_commission_rate) {
            let params = {
                goods_no: this.ruleForm.goods_no,
            };

            this.$post('/student/shop_vip_goods%5Cget_product_list', params, resp => {
                if (resp.code === 1) {
                    resp.data.product_list.forEach(item => {
                        item.check_status = 1;
                        item.product_stock_type = item.product_stock_vip === -1 ? 1 : 2;
                        item.commission_rate_type = Number(item.commission_rate) === -1 ? 1 : 2;
                        item.commission_rate = Number(item.commission_rate);
                        item.goods_commission_rate = goods_commission_rate;
                    });
                    this.ruleForm.price_list = resp.data.product_list;
                    this.discountList = resp.data.wholesale_info ? resp.data.wholesale_info.list : [];
                    this.getPriceVip();
                } else {
                    this.$notify({
                        title: '提示',
                        message: resp.msg,
                        duration: 2000,
                        type: 'warning'
                    });
                }
            });
        },
        /**
         * 限购数量限制
         * @param val
         */
        handleLimitChange(val) {
            if (val === 1) {
                this.ruleForm.goods_buy_limit_vip = 0;
            }
        },
        /**
         * @description 过滤函数
         */
        emptyFormatter(row, column, val) {
            if (!val) return '--';
            return val;
        },

        /**
         * 获取一卡通价格
         */
        getPriceVip() {
            this.ruleForm.price_list = this.ruleForm.price_list.filter(item => {
                if(!this.rules.goods_discount_vip[0].pattern.test(this.ruleForm.goods_discount_vip)) {
                    return item.price_vip = '--';
                }
                return item.price_vip = `${(item.product_price * (Number(this.ruleForm.goods_discount_vip) / 10)).toFixed(2)}`;
            });
        },

        /**
         * 获取商品团购价格列表
         * @param row
         */
        getGroupPrice(row) {
            let discountList = this.discountList;
            let spec_info = '';

            // 规格处理
            row.spec_list.forEach(spec => {
                spec_info += `${spec.spec_name}:${spec.spec_value}；`;
            });

            let result = [{
                spec_list: spec_info,
                goods_price: row.product_price,
                data: discountList
            }];

            this.$refs.groupPriceDialog.show(result);
        },

        /**
         * 选择库存类型
         * @param val
         * @param index
         */
        handleStockTypeChange(val, index) {
            if(val === 1) {
                this.ruleForm.price_list[index].product_stock_vip = -1;
            } else {
                this.ruleForm.price_list[index].product_stock_vip = 0;
            }
        },

        /**
         * 选择佣金类型
         * @param val
         * @param row
         */
        handleRateTypeChange(val, row) {
            if(val === 1) {
                row.commission_rate = -1;
            } else {
                row.commission_rate = row.goods_commission_rate;
            }
        },

        /**
         * 是否平台补贴切换
         * @param val
         * @param index
         */
        handleSubsidyChange(val, index) {
            if(val === 1) {
                this.ruleForm.price_list[index].shop_subsidy_money_by_shop = 0;
            }
        },

        /**
         * 获取商品信息
         * @param goods_no
         */
        getGoodsInfo(goods_no) {
            let params = {
                goods_nos: goods_no
            };

            this.$post('/student/shop_goods%5Cget_list_for_select', params, resp => {
                if (resp.code === 1) {
                    let data = resp.data.list[0];

                    this.ruleForm.goods_cover = data.goods_cover;
                } else {
                    this.$notify({
                        title: '提示',
                        message: resp.msg,
                        type: 'warning'
                    });
                }
            });
        }
    }
};
</script>

<style scoped lang="less">
.wrapper {
    width: 100%;

    .content-wrapper {
        display: flex;
        height: calc(100% - 24px);
        flex-direction: column;
        position: relative;
        margin: 12px;
        background: #fff;
        box-sizing: border-box;
        overflow-y: auto;

        /*header*/

        .header {
            height: 68px;
            padding: 24px;
            box-sizing: border-box;
            box-shadow: 0px -1px 0px 0px #F0F2F5;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #F0F2F5;

            .header-title {
                color: #333333;
                font-size: 20px;
                height: 20px;
                font-weight: 500;
                position: relative;
                margin: 24px 0 24px 12px;

                &::before {
                    content: '';
                    position: absolute;
                    left: -8px;
                    top: -1px;
                    width: 3px;
                    height: 20px;
                    background: #1890FF;
                }
            }
        }

        /*表单*/

        .form-wrap {
            margin: 24px;
            padding: 24px 32px;
            background: #FBFBFB;
            border-radius: 2px;
            border: 1px solid #EEEEEE;

            .form-title {
                font-size: 16px;
                font-family: PingFangSC-Semibold, PingFang SC;
                font-weight: 600;
                color: #333333;
                padding-bottom: 12px;
                border-bottom: 1px solid #E9E9E9;
                margin-bottom: 24px;
            }
            .select-goods-view {
                display: flex;
                height: 148px;
                margin-bottom: 32px;
                .select-goods {
                    width: 148px;
                    height: 148px;
                    background: #FFFFFF;
                    border-radius: 4px;
                    border: 1px solid #20A0FF;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    font-size: 14px;
                    font-family: PingFangSC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #20A0FF;
                    cursor: pointer;
                    margin-right: 32px;
                    .el-icon-plus {
                        font-size: 48px;
                        margin-bottom: 8px;
                    }
                    &.detail {
                        border: 0;
                    }
                    .el-image {
                        width: 100%;
                        height: 100%
                    }
                    &.selected {
                        border: 0;
                        position: relative;
                        &:hover {
                            &::after {
                                content: "";
                                position: absolute;
                                width: 148px;
                                height: 148px;
                                background: rgba(0, 0, 0, 0.6);
                                border-radius: 4px;
                                left: 0;
                                top: 0;
                                display: flex;
                            }
                            &::before {
                                content: "重新选择";
                                position: absolute;
                                width: 112px;
                                height: 36px;
                                background: #FFFFFF;
                                border-radius: 18px;
                                z-index: 1;
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                font-size: 14px;
                                font-family: PingFangSC-Medium, PingFang SC;
                                font-weight: 500;
                                color: #20A0FF;
                            }
                        }
                    }
                }
                .select-goods-info {
                    height: 100%;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    flex: 1;
                    .goods-info-item {
                        display: flex;
                        flex-direction: column;
                        font-size: 14px;
                        font-family: PingFangSC-Regular, PingFang SC;
                        font-weight: 400;
                        color: #555555;
                        margin-bottom: 12px;
                        .goods-info__value {
                            color: #999999;
                        }
                    }
                }
            }
            .input-wrapper {
                margin: 4px 0;
            }

            .zd-spec {
                display: flex;
                font-size: 14px;
                padding-right: 12px;

                .zd-spec-luck-text {
                    margin-right: 10px;
                }
            }

            /deep/ .el-checkbox-group {
                display: flex;
                flex-direction: column;

                .zd-spec {
                    display: flex;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;

                    .zd-spec-text {
                        font-size: 14px;
                        margin-right: 10px;
                    }
                }

                .el-checkbox {
                    width: min-content;
                }
            }

            .tips {
                margin-left: 24px;
                font-size: 14px;
                color: #999;
            }

            .el-radio-group-wrap {
                display: flex;
                flex-direction: column;
                margin-top: 12px;

                .el-radio {
                    display: flex;
                }
            }
        }

        .btn-group {
            margin-left: 120px;
            padding-bottom: 36px;

            .el-button {
                margin: 0 24px;
            }
        }
    }

    /deep/ .el-table__body-wrapper::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
        border-radius: 3px;
        background-color: #a1a3a9;
    }


    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-thumb {
        background-color: #a1a3a9;
        border-radius: 3px;
    }

    /deep/ .el-table {
        border: 1px solid #eee;
        border-radius: 4px;

        th {
            background: #f2f2f2 !important;
        }

        td {
            background: #FBFBFB !important;
            border-bottom: 0;
        }

        .el-table__row.cursor {
            cursor: pointer;
        }
        .el-table__empty-block {
            background: #FBFBFB
        }
        .el-table__body-wrapper {
            background: #FBFBFB
        }
    }
}
</style>
